package day10homework;

public class Zy01 {
	public static void main(String[] args) {
		//String str1 ="   java Android    ";
		String str1 ="-------";
		System.out.println(str1);
		System.out.println(theTrim(str1) );
	}
	public static  String theTrim(String str){
		int start = 0;
		int end= str.length() - 1;
		while(start <= end && str.charAt(start) == '-') {
			start++;
		}
		while(start <= end && str.charAt(end) == '-') {
			end--;
		}
		
		return str.substring(start, end + 1);
	}
}
